home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoTabChooser.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  2.1 KB  |  81 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.  * Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef koTabChooser_h
  21. #define koTabChooser_h
  22.  
  23. #include <qframe.h>
  24. #include <koffice_export.h>
  25. class QMouseEvent;
  26. class QPainter;
  27. class QPopupMenu;
  28.  
  29. /**
  30.  *  class KoTabChooser
  31.  */
  32.  
  33. class KoTabChooserPrivate;
  34.  
  35. class KOFFICEUI_EXPORT KoTabChooser : public QFrame
  36. {
  37.     Q_OBJECT
  38.  
  39. public:
  40.     enum { TAB_LEFT = 1,
  41.            TAB_CENTER = 2,
  42.            TAB_RIGHT = 4,
  43.            TAB_DEC_PNT = 8,
  44.            TAB_ALL = TAB_LEFT | TAB_CENTER | TAB_RIGHT | TAB_DEC_PNT };
  45.  
  46.     KoTabChooser( QWidget *parent, int _flags );
  47.     ~KoTabChooser();
  48.  
  49.     int getCurrTabType() { return currType; }
  50.     
  51.     /**
  52.      * put m_bReadWrite to true as default
  53.      * and used setReadWrite(false) to make in readOnly mode
  54.      */
  55.     void setReadWrite(bool _readWrite);
  56.  
  57. protected:
  58.     void mousePressEvent( QMouseEvent *e );
  59.     void drawContents( QPainter *painter );
  60.     void setupMenu();
  61.  
  62.     int flags;
  63.     int currType;
  64.     QPopupMenu *rb_menu;
  65.     int mLeft;
  66.     int mRight;
  67.     int mCenter;
  68.     int mDecPoint;
  69.  
  70.     KoTabChooserPrivate *d;
  71.  
  72. protected slots:
  73.     void rbLeft() { currType = TAB_LEFT; repaint( true ); }
  74.     void rbCenter() { currType = TAB_CENTER; repaint( true ); }
  75.     void rbRight() { currType = TAB_RIGHT; repaint( true ); }
  76.     void rbDecPoint() { currType = TAB_DEC_PNT; repaint( true ); }
  77.  
  78. };
  79.  
  80. #endif
  81.